package org.springblade.modules.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.modules.repair.entity.RescueScreenConfig;
import org.springblade.modules.repair.entity.ZgRedeployConfig;
import org.springblade.modules.system.dto.ReportConfig;
import org.springblade.modules.system.vo.config.AlarmConfig;
import org.springblade.modules.system.vo.config.AlarmLabelConfig;
import org.springblade.modules.system.vo.config.AlarmNotifyConfig;
import org.springblade.modules.system.vo.config.RescueSignConfig;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * @Date 10:21 2023/4/6
 * @Description {
 *   租户业务配置
 * }
 * @Author lsay
 **/
@Data
@TableName(value = "blade_tenant_config")
public class TenantConfig implements Serializable {

	/**
	 * 主键
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	private Long id;

    /**
     * 配置参数
     */
    @TableField(value = "config",typeHandler = JacksonTypeHandler.class)
    private Map<String,Object> config;

	/**
	 * 大屏人员角色配置
	 */
	@TableField(value = "screen_roles",updateStrategy = FieldStrategy.IGNORED)
	private String screenRoles;

	/**
	 * 2024-07-23 新增
	 * 维修报告发送配置
	 */
	@TableField(value = "report_config",typeHandler = JacksonTypeHandler.class)
	private ReportConfig reportConfig;

	/**
	 * 2024-03-08 新增
	 * 救援配置参数：交通工具距离与阈值
	 */
	@TableField(value = "rescue_screen_config",typeHandler = JacksonTypeHandler.class)
	private RescueScreenConfig rescueScreenConfig;

	@TableField(value = "rescue_sign_config",typeHandler = JacksonTypeHandler.class)
	private RescueSignConfig rescueSignConfig;

	/**
	 * 2025-04-16 新增
	 * 整改工单转派配置
	 */
	@TableField(value = "zg_redeploy_config",typeHandler = JacksonTypeHandler.class)
	private ZgRedeployConfig zgRedeployConfig;

	/**
	 * 困人报警通知设置
	 */
	@TableField(value = "alarm_notify_config",typeHandler = JacksonTypeHandler.class)
	private AlarmNotifyConfig alarmNotifyConfig;

	/**
	 * 自动报警设置
	 */
	@TableField(value = "alarm_config",typeHandler = JacksonTypeHandler.class)
	private AlarmConfig alarmConfig;

	/**
	 * 报警标签设置
	 */
	@TableField(value = "alarm_label_config",typeHandler = JacksonTypeHandler.class)
	private AlarmLabelConfig alarmLabelConfig;

	/**
	 * 租户id
	 */
	@TableField(value = "tenant_id")
	private String tenantId;

	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	private Date createTime;

	/**
	 * 更新时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	private Date updateTime;

}
